﻿using System;
using System.Windows.Data;
using NthDownload.PlaceHolders;

namespace NthDownload.Converters
{
    public class BandwidthProviderNoneSelectionToNullConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value ?? BandwidthProviderNoneSelection.Instance;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value == BandwidthProviderNoneSelection.Instance ? null : value;
        }
    }
}
